package com.example.fastshare;

import android.content.Intent;
import android.os.Bundle;
import android.provider.ContactsContract.CommonDataKinds.Im;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.TextView;

public class SettingFragment extends Fragment {
	public SettingFragment() {
	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		View rootView = inflater.inflate(R.layout.setting, container, false);

		ImageView btnProfile = (ImageView) rootView.findViewById(R.id.profile_img_btn);
		btnProfile.setOnClickListener(new View.OnClickListener() {
			public void onClick(View view) {
				Intent myIntent = new Intent(view.getContext(),
						ProfileActivity.class);
				startActivityForResult(myIntent, 0);
			}
		});
		ImageView btnBlackList = (ImageView) rootView.findViewById(R.id.blackList_img_btn);
		btnBlackList.setOnClickListener(new View.OnClickListener() {
			public void onClick(View view) {
				Intent myIntent = new Intent(view.getContext(),
						BlacklistAndFavouritesActivity.class);
				myIntent.putExtra("tabIndex", "blacklist");
				startActivityForResult(myIntent, 1);
			}
		});
		ImageView btnFavorite = (ImageView) rootView.findViewById(R.id.favouriteList_img_btn);
		btnFavorite.setOnClickListener(new View.OnClickListener() {
			public void onClick(View view) {
				Intent myIntent = new Intent(view.getContext(),
						BlacklistAndFavouritesActivity.class);
				myIntent.putExtra("tabIndex", "favourite");
				startActivityForResult(myIntent, 1);
			}
		});
		TextView profile = (TextView) rootView.findViewById(R.id.profile);
		profile.setOnClickListener(new View.OnClickListener() {
			public void onClick(View view) {
				Intent myIntent = new Intent(view.getContext(),
						ProfileActivity.class);
				startActivityForResult(myIntent, 0);
			}
		});

		TextView blackList = (TextView) rootView.findViewById(R.id.blackList);
		blackList.setOnClickListener(new View.OnClickListener() {
			public void onClick(View view) {
				Intent myIntent = new Intent(view.getContext(),
						BlacklistAndFavouritesActivity.class);
				myIntent.putExtra("tabIndex", "blacklist");
				startActivityForResult(myIntent, 1);
			}
		});

		TextView favouriteList = (TextView) rootView
				.findViewById(R.id.favouriteList);
		favouriteList.setOnClickListener(new View.OnClickListener() {
			public void onClick(View view) {
				Intent myIntent = new Intent(view.getContext(),
						BlacklistAndFavouritesActivity.class);
				myIntent.putExtra("tabIndex", "favourite");
				startActivityForResult(myIntent, 1);
			}
		});
		return rootView;
	}
}